# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=stacs
pkgver=0.5.1.r0.g11f3503
pkgrel=6
pkgdesc='Static Token And Credential Scanner.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-scanner' 'blackarch-misc')
url='https://github.com/stacscan/stacs'
license=('BSD-3-Clause')
depends=('python' 'python-click' 'python-pydantic' 'python-yara-python-dex'
         'python-libarchive' 'pybind11')
makedepends=('git' 'python-setuptools' 'python-pip')
source=("git+https://github.com/stacscan/$pkgname.git")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

